/*!
 * @author Isis (igraziatto) Graziatto <isis.g@vanillaforums.com>
 * @copyright 2009-2018 Vanilla Forums Inc.
 * @license GPL-2.0-only
 */

/* -------------------------------------------------------------- *\
    Styles
\* -------------------------------------------------------------- */

body.Section-BestOf {
    @include noPanel;

    .SearchBox {
        display: none;
    }

    .Frame-content {
        > .Container {
            max-width: $global-main_width;
        }
    }

    .FilterMenu {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        margin: $utility-baseUnitTriple -#{$utility-baseUnitHalf} $utility-baseUnitTriple;
        width: calc(100% + (#{$utility-baseUnitHalf} * 2));

        > li {
            margin: 0 $utility-baseUnitHalf $utility-baseUnit;
        }

        a {
            @include Button;
        }

        .ReactSprite {
            line-height: calc(#{$formButton_height} - 2px);
            height: inherit;
        }

        .BestOfEverything {
            .ReactSprite {
                display: none;
            }
        }

        li.Active {
            a {
                background-color: $button-basic-hover_bg;
                border-color: $button-basic-hover_border;
                color: $button-basic-hover_fg;
            }
        }
    }

    .Frame-details {
        padding-bottom: $utility-baseUnit;
    }

    .MainContent {
        min-height: 150px;
        margin: 0;
        width: 100%;
    }

    .DismissMessage {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 24px;
    }

    .Tiles {
        @include clearfix;
        position: relative;
        margin: 0 #{-$utility-baseUnit};
        width: calc(100% + #{$utility-baseUnit});

        @include maxWidth {
            margin: 0;
            width: 100%;

            .Tile:first-child {
                margin-top: 0;
            }
        }
    }

    .Tile {
        position: relative;
        display: block;
        width: calc((100% / 3) - (#{$utility-baseUnit} * 2));
        margin: 0 $utility-baseUnit $utility-baseUnitDouble;
        background: $component_bg;
        padding: $component-base_padding;

        @if ($component_borderRadius == 0) {
            border-radius: $global_borderRadius;
        } @else {
            border-radius: $component_borderRadius;
        }

        @include maxWidth($theme-breakpoint_tablet) {
            width: calc((100% / 2) - (#{$utility-baseUnit} * 2));
        }

        .AuthorWrap {
            margin-left: -#{$component-base_padding};
            margin-right: -#{$component-base_padding};
            margin-bottom: -#{$component-base_padding};
            padding: $component-base_padding;
            min-height: calc(#{$theme-photo_size} + #{$component-vertical_padding} * 2);
            background-color: $component-header_bg;

            @if ($component_borderRadius == 0) {
                border-bottom-left-radius: $global_borderRadius;
                border-bottom-right-radius: $global_borderRadius;
            } @else {
                border-bottom-left-radius: $component_borderRadius;
                border-bottom-right-radius: $component_borderRadius;
            }
        }

        .Title,
        .Title a {
            display: block;
            background: none;
            font-size: $component-title_fontSize;
            font-weight: $component-title_fontWeight;
            line-height: #{$theme-photo_size * 0.5};
            color: $component-title_color;
            margin-bottom: $utility-baseUnit;

            &:focus,
            &:hover {
                color: $component-title-hover_color;
            }

            a {
                font-size: inherit;
                font-weight: inherit;
                display: inline;
                color: inherit;

                &:focus,
                &:hover {
                    color: inherit;
                }
            }
        }

        .Message {
            $line-height: 20px;
            $num-lines: 20;

            display: block;
            line-height: $line-height;
            max-height: $line-height * $num-lines;
            overflow: hidden;
            position: relative;
            margin: 0 0 $utility-baseUnit;
        }

        .Reactions {
            padding-left: calc(#{$theme-photo_size} + #{$utility-baseUnitDouble} - #{$utility-baseUnit});

            @include maxWidth {
                padding-left: 0;
                margin-left: -$utility-baseUnit;
            }
        }

        .ReactSprite {
            margin-right: 0;
        }
    }

    .Tile,
    .Item {
        .Item-Header,
        .Item-BodyWrap {
            margin-bottom: $utility-baseUnit;
        }

        .Author,
        .Meta {
            line-height: $component-meta_lineHeight;
        }

        .Author {
            display: block;

            @if ($staticVariables) {
                a {
                    line-height: inherit;
                    color: $component-meta-link_color;
                    font-size: $component-meta_fontSize;
                    font-weight: $component-meta_fontWeight;

                    &:hover,
                    &:focus,
                    &:active {
                        color: $component-meta-link-hover_color;
                    }
                }
            }

            a:not(.PhotoWrap) {
                margin-left: $utility-baseUnitDouble;
            }
        }

        .PhotoWrap {
            margin: 0;
        }

        .ProfilePhoto.ProfilePhoto {
            width: 100%;
            height: auto;
        }

        .ReactButton {
            margin: 0 $utility-baseUnit;

            @include maxWidth {
                min-height: 42px;
                min-width: 42px;
                display: inline-flex;
                align-items: center;
                justify-content: center;

                .ReactSprite::before {
                    font-size: $icon-default_size;
                }
            }
        }
    }

    .Item {
        .Meta {
            padding-left: calc(#{$theme-photo_size} + #{$utility-baseUnitDouble});

            @include maxWidth {
                margin-top: 0;
            }
        }
    }

    &.UserLoggedOut {
        .Author {
            display: flex;
            align-items: center;

            .PhotoWrap {
                margin: 0;
                margin-right: $utility-baseUnitHalf;
            }
        }
    }

    @include maxWidth {
        .ImageWrap {
            width: 100%;
        }

        .Tile {
            margin: $utility-baseUnitDouble 0;
        }
    }
}
